# -*- coding: utf-8 -*-

# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
from sched import scheduler

import scrapy
from scrapy.loader import ItemLoader
from scrapy.loader.processors import MapCompose, TakeFirst, Join

class B2BcategoryItem(scrapy.Item):
    # define the fields for your item here like:
    # name = scrapy.Field()
    name = scrapy.Field()
    href = scrapy.Field()
    category = scrapy.Field()
    contact = scrapy.Field()
    address = scrapy.Field()
    numPerDay = scrapy.Field()
    customPerPrice = scrapy.Field()

class B2BMaincategoryItem(scrapy.Item):
    name = scrapy.Field()
    href = scrapy.Field()


class B2BcategoryLoader(ItemLoader):
    default_item_class = B2BcategoryItem
    default_input_processor = MapCompose(lambda s: s.strip())
    default_output_processor = TakeFirst()
    description_out = Join()

class B2BMaincategoryLoader(ItemLoader):
    default_item_class = B2BMaincategoryItem
    default_input_processor = MapCompose(lambda s: s.strip())
    default_output_processor = TakeFirst()
    description_out = Join()

